package com.music.message.controller;

import com.music.common.core.web.domain.AjaxResult;
import com.music.common.security.annotation.InnerAuth;
import com.music.message.service.UserMessageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * Author 史豪通
 * Date 2024/10/09 23:29
 */
@RestController
@RequestMapping("/user")
public class UserMessageController {
    @Resource
    UserMessageService userMessageService;

    @RequestMapping("/register/send")
    public AjaxResult ampqSendUserRegister(String phone) {
        userMessageService.ampqSendUserRegister(phone);
        return AjaxResult.success("发送成功！");
    }

    @InnerAuth
    @GetMapping("check")
    public void check(@RequestParam("phone") String phone, @RequestParam("code") String code) {
        System.out.println("check phone -> " + phone + " code -> " + code);
        userMessageService.ampqCheck(phone, code);
    }
}
